package com.woniuxy.school.gateway.conig;

import org.springframework.stereotype.Component;
import springfox.documentation.swagger.web.SwaggerResource;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;

import java.util.Arrays;
import java.util.List;

@Component
public class SwaggerResroueConfig implements SwaggerResourcesProvider {
    @Override
    public List<SwaggerResource> get() {


        return Arrays.asList(
                createResource("评论服务","/comment/v2/api-docs"),
                createResource("菜品服务","/food/v2/api-docs"),
                createResource("膳食订单","/order/v2/api-docs"),
                createResource("商家服务","/store/v2/api-docs"),
                createResource("用户服务","/user/v2/api-docs"),
                createResource("维修报单评论服务","/onlineComment/v2/api-docs"),
                createResource("维修报单服务","/onlineRepair/v2/api-docs")

        );
    }
    private SwaggerResource createResource(String name, String location) {
        SwaggerResource swaggerResource = new SwaggerResource();
        swaggerResource.setName(name);
        swaggerResource.setLocation(location);
        swaggerResource.setSwaggerVersion("2.0");
        return swaggerResource;
    }
}
